﻿using System;
using System.Collections.Generic;
using HAVNet.Core.String;


namespace HAVNet.Intros.AST
{
    public class ASTAnonMethodParams : List<ASTAnonMethodParam>
    {
        public override string ToString ()
        {
            return Strings.joinobjs (", ", this);
        }
    }

    public class ASTAnonMethodParam : ASTNode
    {
        public bool     isRef   { get; set; }
        public bool     isOut   { get; set; }
        public string   ident   { get; set; }
        public ASTType  type    { get; set; }

        public override string ToString ()
        {
            string sRefOrOut = "";

            if (isRef) sRefOrOut += "ref";
            if (isOut) sRefOrOut += "out";

            return sRefOrOut + " " + type + " " + ident;
        }
    }
}
